<template>
    <div>
        姓名<input type="text" v-model="state.Name">
        电话<input type="text" v-model="state.Phone">
        <input type="button" value="添加" @click="show">
        <table class="table table-bordered"> 1
            <tr>
                <td>名字</td>
                <td>电话</td>
                <td>身份证</td>
                <td>生日日期</td>
                <td>性别</td>
                <td>密码</td>
                <td>余额</td>
                <td>积分</td>

            </tr>

            <tr v-for="item in list">
                <td>{{ item.name }}</td>
                <td>{{ item.phone }}</td>
                <td>{{ item.card }}</td>
                <td>{{ item.brithday.split('T')[0] }}</td>
                <td>{{ item.sex==1?'男':'女' }}</td>
                <td>{{ item.pwd }}</td>
                <td>{{ item.money.toFixed(2) }}</td>
                <td>{{ item.jiFen }}</td>
            </tr>
        </table>
    </div>
</template>

<script setup lang="ts">
import { reactive, toRefs, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
let router = useRouter();
let route = useRoute();

let data: any = reactive({
    state: {
        "Name": "",
        "Phone": "",
       
    },
   list: [],
});
let { state, list } = toRefs(data);

onMounted(() => {
    show();
})

const show = () => {
    let obj = {
        "Name": state.value.Name,
        "Phone": state.value.Phone,
    };
    axios({
        url: '/api/Member/ShowMember',
        method: 'get',
        params: obj
    }).then(res => {
        list.value = res.data.data;
    })
};
</script>

<style scoped></style>